<template >

  <div class="text-center"  >
  		<div class="h1 mt50 red" >{{msg}}</div>
  		<img :src="configureinfo.qrcodeimg" class="mt20" width="200" height="200" >
  		<div class="h2 mt10 hui"> 识别二维码，关注 {{configureinfo.company_name}} 公众号</div>
  </div>

</template>

<script>

import { mapGetters, mapActions } from 'vuex'


export default {
	name: 'applyseller',
	data () {
		return {
			msg : '',
		}
	},

	computed: {
		...mapGetters([
		    'configureinfo',
		    'company_code',
		]),
	},

	methods: {


	},

	created () {

		this.$store.dispatch('getConfigureinfo', {
			'company_code' : this.company_code,
			'callback' : () => {}
		});

		var u = this.$route.query.u;
		var company_code = this.company_code;
		console.log(u);
		console.log(company_code);

		this.$store.dispatch('applySeller', {
			'user_base' : u,
			'company_code' : company_code,
			'callback' : (res) => {
				console.log(res);
				if(res == '1'){
					//MessageBox('提示', '你已经成为分销商，请关注公众号。');
					this.msg = '你已经成为分销商，请关注公众号。';
				}else if(res == '0'){
					//MessageBox('提示', '已经成功发送成为分销商申请，请等待通过。');
					this.msg = '已经成功发送成为分销商申请，请等待通过。';
				}else{
					//MessageBox('提示', '系统异常，请稍后再试');
					this.msg = '系统异常，请稍后再试';
				}
			},
			'err' : (res) => {
				this.msg = res;
			}
		});

	},


}
</script>

<style scoped>


</style>
